/**
*      author: Y_Yao
*      created: 2024-10-20 10:47:03
**/

#include<bits/stdc++.h>

using namespace std;
using LL = long long;
const LL LLINF = 1e18;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 7;
int a[N];
int n,c;

bool check(int mid)
{
    int ret = 1;
    int prev = a[1];
    for(int i = 2;i <= n;i++)
    {
        if(a[i] - prev >= mid)
        {
            ret++;
            prev = a[i];
        }
    }
    if(ret >= c) return true;
    else return false;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> c;
    for(int i = 1;i <= n;i++) cin >> a[i];

    sort(a + 1,a + 1 + n);
    int l = 0,r = a[n] - a[1] + 1;
    while(l < r)
    {
        int mid = (r + l + 1) >> 1;
        if(check(mid)) l = mid;
        else r = mid - 1;
    }

    cout << l;
    return 0;
}
